<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>转换设计</title>
    <link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="design.css"/>

    <script type="text/javascript" src="../jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../jquery/env.js"></script>

    <script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<!--    <script type="text/javascript" src="plugins/design.js"></script>-->
    <script type="text/javascript" src="plugins/step.js"></script>
    <script type="text/javascript" src="plugins/units.js"></script>

    <style>

    </style>
</head>
<body class="easyui-layout">
<div data-options="region:'west',width:180"></div>

<div data-options="region:'center',fit:true">
    <div id="design"></div>
</div>

</body>
<script>
    $(function () {
        //获取url参数
        var urlParams = new URLSearchParams(window.location.search);
        let convertId = urlParams.get('convertId');
        $.get($.rootUrl + '/zjk/convert/convertStepList', {convertId: convertId}, function (res) {
            if(res.success){
                let steps = res.result;
                $.each(steps,function (i,item) {
                    var options = $.extend({},item);
                    let id = item.stepId;
                    if(id.indexOf(':')>-1){
                        id=id.replace(':','_');
                    }
                    $('<div id="'+id+'"></div>').appendTo('#design').step(options)
                });

            }else{
                $.messager.alert('警告','读取转换步骤失败!');
            }
        });

        /*    $.getJSON("../test/menus.json",function (data) {
                var menus =data.menus;
                $.fn.convert.methods.open(menus);
            });

            $.getJSON("../test/steps.json",function (data) {
                var steps =data.steps;
                $.fn.convert.methods.openDesign(steps);
            });*/
    })

</script>
</html>
